package model;

import javax.persistence.OneToOne;
import java.io.Serializable;

/**
 * Created by admin on 2016/8/16.
 */
public class Detail implements Serializable {
    private int id;
    private Integer orderId;
    private Integer dishId;
    private Integer amount;
    private String cate;
    private Order order;
    private Dish dish;

    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public Integer getOrderId() {
        return orderId;
    }

    public void setOrderId(Integer orderId) {
        this.orderId = orderId;
    }

    public Integer getDishId() {
        return dishId;
    }

    public void setDishId(Integer dishId) {
        this.dishId = dishId;
    }

    public Integer getAmount() {
        return amount;
    }

    public void setAmount(Integer amount) {
        this.amount = amount;
    }

    public String getCate() {
        return cate;
    }

    public void setCate(String cate) {
        this.cate = cate;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        Detail detail = (Detail) o;

        if (id != detail.id) return false;
        if (orderId != null ? !orderId.equals(detail.orderId) : detail.orderId != null) return false;
        if (dishId != null ? !dishId.equals(detail.dishId) : detail.dishId != null) return false;
        if (amount != null ? !amount.equals(detail.amount) : detail.amount != null) return false;
        if (cate != null ? !cate.equals(detail.cate) : detail.cate != null) return false;

        return true;
    }

    @Override
    public int hashCode() {
        int result = id;
        result = 31 * result + (orderId != null ? orderId.hashCode() : 0);
        result = 31 * result + (dishId != null ? dishId.hashCode() : 0);
        result = 31 * result + (amount != null ? amount.hashCode() : 0);
        result = 31 * result + (cate != null ? cate.hashCode() : 0);
        return result;
    }

    public Order getOrder() {
        return order;
    }

    public void setOrder(Order order) {
        this.order = order;
    }

    public Dish getDish() {
        return dish;
    }

    public void setDish(Dish dish) {
        this.dish = dish;
    }
}
